.class public Lorg/microemu/microedition/io/ConnectorImpl;
.super Lorg/microemu/microedition/io/ConnectorAdapter;
.source "ConnectorImpl.java"


# static fields
.field static class$javax$microedition$io$Connection:Ljava/lang/Class;

.field static class$org$microemu$microedition$io$ConnectorImpl:Ljava/lang/Class;

.field public static debugConnectionInvocations:Z


# instance fields
.field private acc:Ljava/security/AccessControlContext;

.field private final needPrivilegedCalls:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 57
    const/4 v0, 0x0

    sput-boolean v0, Lorg/microemu/microedition/io/ConnectorImpl;->debugConnectionInvocations:Z

    return-void
.end method

.method public constructor <init>()V
    .locals 1

    .prologue
    .line 61
    invoke-direct {p0}, Lorg/microemu/microedition/io/ConnectorAdapter;-><init>()V

    .line 59
    invoke-static {}, Lorg/microemu/microedition/io/ConnectorImpl;->isWebstart()Z

    move-result v0

    iput-boolean v0, p0, Lorg/microemu/microedition/io/ConnectorImpl;->needPrivilegedCalls:Z

    .line 62
    invoke-static {}, Ljava/security/AccessController;->getContext()Ljava/security/AccessControlContext;

    move-result-object v0

    iput-object v0, p0, Lorg/microemu/microedition/io/ConnectorImpl;->acc:Ljava/security/AccessControlContext;

    .line 63
    return-void
.end method

.method static access$000(Lorg/microemu/microedition/io/ConnectorImpl;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 51
    iget-boolean v0, p0, Lorg/microemu/microedition/io/ConnectorImpl;->needPrivilegedCalls:Z

    return v0
.end method

.method static access$100(Lorg/microemu/microedition/io/ConnectorImpl;Ljava/lang/String;IZZ)Ljavax/microedition/io/Connection;
    .locals 1
    .parameter "x0"
    .parameter "x1"
    .parameter "x2"
    .parameter "x3"
    .parameter "x4"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 51
    invoke-direct {p0, p1, p2, p3, p4}, Lorg/microemu/microedition/io/ConnectorImpl;->openSecureProxy(Ljava/lang/String;IZZ)Ljavax/microedition/io/Connection;

    move-result-object v0

    return-object v0
.end method

.method static access$200(Lorg/microemu/microedition/io/ConnectorImpl;Ljava/lang/String;IZ)Ljavax/microedition/io/Connection;
    .locals 1
    .parameter "x0"
    .parameter "x1"
    .parameter "x2"
    .parameter "x3"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 51
    invoke-direct {p0, p1, p2, p3}, Lorg/microemu/microedition/io/ConnectorImpl;->openSecure(Ljava/lang/String;IZ)Ljavax/microedition/io/Connection;

    move-result-object v0

    return-object v0
.end method

.method static class$(Ljava/lang/String;)Ljava/lang/Class;
    .locals 2
    .parameter "x0"

    .prologue
    .line 113
    :try_start_0
    invoke-static {p0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
    :try_end_0
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    return-object v1

    :catch_0
    move-exception v0

    .local v0, x1:Ljava/lang/ClassNotFoundException;
    new-instance v1, Ljava/lang/NoClassDefFoundError;

    invoke-direct {v1}, Ljava/lang/NoClassDefFoundError;-><init>()V

    invoke-virtual {v1, v0}, Ljava/lang/NoClassDefFoundError;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;

    move-result-object v1

    throw v1
.end method

.method private static getAllInterfaces(Ljava/lang/Class;)[Ljava/lang/Class;
    .locals 5
    .parameter "klass"

    .prologue
    .line 94
    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    .line 95
    .local v0, allInterfaces:Ljava/util/Vector;
    move-object v3, p0

    .line 96
    .local v3, parent:Ljava/lang/Class;
    :goto_0
    if-eqz v3, :cond_1

    .line 97
    invoke-virtual {v3}, Ljava/lang/Class;->getInterfaces()[Ljava/lang/Class;

    move-result-object v2

    .line 98
    .local v2, interfaces:[Ljava/lang/Class;
    const/4 v1, 0x0

    .local v1, i:I
    :goto_1
    array-length v4, v2

    if-ge v1, v4, :cond_0

    .line 99
    aget-object v4, v2, v1

    invoke-virtual {v0, v4}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 98
    add-int/lit8 v1, v1, 0x1

    goto :goto_1

    .line 101
    :cond_0
    invoke-virtual {v3}, Ljava/lang/Class;->getSuperclass()Ljava/lang/Class;

    move-result-object v3

    .line 102
    goto :goto_0

    .line 104
    .end local v2           #interfaces:[Ljava/lang/Class;
    .end local v1           #i:I
    :cond_1
    invoke-virtual {v0}, Ljava/util/Vector;->size()I

    move-result v4

    new-array v4, v4, [Ljava/lang/Class;

    invoke-virtual {v0, v4}, Ljava/util/Vector;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, [Ljava/lang/Class;

    check-cast p0, [Ljava/lang/Class;

    return-object p0
.end method

.method private static isWebstart()Z
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 67
    :try_start_0
    const-string v1, "javawebstart.version"

    invoke-static {v1}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    if-eqz v1, :cond_0

    const/4 v1, 0x1

    .line 70
    :goto_0
    return v1

    :cond_0
    move v1, v2

    .line 67
    goto :goto_0

    .line 68
    :catch_0
    move-exception v1

    move-object v0, v1

    .local v0, e:Ljava/lang/SecurityException;
    move v1, v2

    .line 70
    goto :goto_0
.end method

.method private openSecure(Ljava/lang/String;IZ)Ljavax/microedition/io/Connection;
    .locals 11
    .parameter "name"
    .parameter "mode"
    .parameter "timeouts"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    const-string v10, "Unable to create"

    const-string v7, "connection ["

    const-string v7, "] class not found"

    .line 130
    const/4 v2, 0x0

    .line 131
    .local v2, className:Ljava/lang/String;
    const/4 v6, 0x0

    .line 134
    .local v6, protocol:Ljava/lang/String;
    const/4 v7, 0x0

    const/16 v8, 0x3a

    :try_start_0
    invoke-virtual {p1, v8}, Ljava/lang/String;->indexOf(I)I

    move-result v8

    invoke-virtual {p1, v7, v8}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v6

    .line 135
    new-instance v7, Ljava/lang/StringBuffer;

    invoke-direct {v7}, Ljava/lang/StringBuffer;-><init>()V

    const-string v8, "org.microemu.cldc."

    invoke-virtual {v7, v8}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    invoke-virtual {v7, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    const-string v8, ".Connection"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v2

    .line 136
    invoke-static {v2}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v1

    .line 137
    .local v1, cl:Ljava/lang/Class;
    invoke-virtual {v1}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;

    move-result-object v5

    .line 138
    .local v5, inst:Ljava/lang/Object;
    instance-of v7, v5, Lorg/microemu/microedition/io/ConnectionImplementation;

    if-eqz v7, :cond_0

    .line 139
    check-cast v5, Lorg/microemu/microedition/io/ConnectionImplementation;

    .end local v5           #inst:Ljava/lang/Object;
    invoke-interface {v5, p1, p2, p3}, Lorg/microemu/microedition/io/ConnectionImplementation;->openConnection(Ljava/lang/String;IZ)Ljavax/microedition/io/Connection;

    move-result-object v7

    .line 148
    :goto_0
    return-object v7

    .line 141
    .restart local v5       #inst:Ljava/lang/Object;
    :cond_0
    check-cast v5, Lorg/microemu/cldc/ClosedConnection;

    .end local v5           #inst:Ljava/lang/Object;
    invoke-interface {v5, p1}, Lorg/microemu/cldc/ClosedConnection;->open(Ljava/lang/String;)Ljavax/microedition/io/Connection;
    :try_end_0
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_2
    .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_3

    move-result-object v7

    goto :goto_0

    .line 143
    .end local v1           #cl:Ljava/lang/Class;
    :catch_0
    move-exception v7

    move-object v3, v7

    .line 145
    .local v3, e:Ljava/lang/ClassNotFoundException;
    :try_start_1
    new-instance v7, Ljava/lang/StringBuffer;

    invoke-direct {v7}, Ljava/lang/StringBuffer;-><init>()V

    const-string v8, "com.sun.cdc.io.j2me."

    invoke-virtual {v7, v8}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    invoke-virtual {v7, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    const-string v8, ".Protocol"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v2

    .line 146
    .restart local v2       #className:Ljava/lang/String;
    invoke-static {v2}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v1

    .line 147
    .restart local v1       #cl:Ljava/lang/Class;
    invoke-virtual {v1}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/sun/cdc/io/ConnectionBaseInterface;

    .line 148
    .local v0, base:Lcom/sun/cdc/io/ConnectionBaseInterface;
    const/16 v7, 0x3a

    invoke-virtual {p1, v7}, Ljava/lang/String;->indexOf(I)I

    move-result v7

    add-int/lit8 v7, v7, 0x1

    invoke-virtual {p1, v7}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v7

    invoke-interface {v0, v7, p2, p3}, Lcom/sun/cdc/io/ConnectionBaseInterface;->openPrim(Ljava/lang/String;IZ)Ljavax/microedition/io/Connection;
    :try_end_1
    .catch Ljava/lang/ClassNotFoundException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/lang/InstantiationException; {:try_start_1 .. :try_end_1} :catch_2
    .catch Ljava/lang/IllegalAccessException; {:try_start_1 .. :try_end_1} :catch_3

    move-result-object v7

    goto :goto_0

    .line 149
    .end local v1           #cl:Ljava/lang/Class;
    .end local v0           #base:Lcom/sun/cdc/io/ConnectionBaseInterface;
    :catch_1
    move-exception v7

    move-object v4, v7

    .line 150
    .local v4, ex:Ljava/lang/ClassNotFoundException;
    :try_start_2
    new-instance v7, Ljava/lang/StringBuffer;

    invoke-direct {v7}, Ljava/lang/StringBuffer;-><init>()V

    const-string v8, "connection ["

    invoke-virtual {v7, v8}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    invoke-virtual {v7, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    const-string v8, "] class not found"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v7, v3}, Lorg/microemu/log/Logger;->debug(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 151
    new-instance v7, Ljava/lang/StringBuffer;

    invoke-direct {v7}, Ljava/lang/StringBuffer;-><init>()V

    const-string v8, "connection ["

    invoke-virtual {v7, v8}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    invoke-virtual {v7, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    const-string v8, "] class not found"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v7, v4}, Lorg/microemu/log/Logger;->debug(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 152
    new-instance v7, Ljavax/microedition/io/ConnectionNotFoundException;

    new-instance v8, Ljava/lang/StringBuffer;

    invoke-direct {v8}, Ljava/lang/StringBuffer;-><init>()V

    const-string v9, "connection ["

    invoke-virtual {v8, v9}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v8

    invoke-virtual {v8, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v8

    const-string v9, "] class not found"

    invoke-virtual {v8, v9}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-direct {v7, v8}, Ljavax/microedition/io/ConnectionNotFoundException;-><init>(Ljava/lang/String;)V

    throw v7
    :try_end_2
    .catch Ljava/lang/InstantiationException; {:try_start_2 .. :try_end_2} :catch_2
    .catch Ljava/lang/IllegalAccessException; {:try_start_2 .. :try_end_2} :catch_3

    .line 155
    .end local v3           #e:Ljava/lang/ClassNotFoundException;
    .end local v4           #ex:Ljava/lang/ClassNotFoundException;
    :catch_2
    move-exception v7

    move-object v3, v7

    .line 156
    .local v3, e:Ljava/lang/InstantiationException;
    const-string v7, "Unable to create"

    invoke-static {v10, v2, v3}, Lorg/microemu/log/Logger;->error(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 157
    new-instance v7, Ljavax/microedition/io/ConnectionNotFoundException;

    invoke-direct {v7}, Ljavax/microedition/io/ConnectionNotFoundException;-><init>()V

    throw v7

    .line 158
    .end local v3           #e:Ljava/lang/InstantiationException;
    :catch_3
    move-exception v7

    move-object v3, v7

    .line 159
    .local v3, e:Ljava/lang/IllegalAccessException;
    const-string v7, "Unable to create"

    invoke-static {v10, v2, v3}, Lorg/microemu/log/Logger;->error(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 160
    new-instance v7, Ljavax/microedition/io/ConnectionNotFoundException;

    invoke-direct {v7}, Ljavax/microedition/io/ConnectionNotFoundException;-><init>()V

    throw v7
.end method

.method private openSecureProxy(Ljava/lang/String;IZZ)Ljavax/microedition/io/Connection;
    .locals 7
    .parameter "name"
    .parameter "mode"
    .parameter "timeouts"
    .parameter "needPrivilegedCalls"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    const-string v6, "javax.microedition.io.Connection"

    .line 109
    invoke-direct {p0, p1, p2, p3}, Lorg/microemu/microedition/io/ConnectorImpl;->openSecure(Ljava/lang/String;IZ)Ljavax/microedition/io/Connection;

    move-result-object v3

    .line 110
    .local v3, origConnection:Ljavax/microedition/io/Connection;
    const/4 v0, 0x0

    .line 111
    .local v0, connectionClass:Ljava/lang/Class;
    invoke-virtual {v3}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v4

    invoke-static {v4}, Lorg/microemu/microedition/io/ConnectorImpl;->getAllInterfaces(Ljava/lang/Class;)[Ljava/lang/Class;

    move-result-object v2

    .line 112
    .local v2, interfaces:[Ljava/lang/Class;
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    array-length v4, v2

    if-ge v1, v4, :cond_0

    .line 113
    sget-object v4, Lorg/microemu/microedition/io/ConnectorImpl;->class$javax$microedition$io$Connection:Ljava/lang/Class;

    if-nez v4, :cond_1

    const-string v4, "javax.microedition.io.Connection"

    invoke-static {v6}, Lorg/microemu/microedition/io/ConnectorImpl;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v4

    sput-object v4, Lorg/microemu/microedition/io/ConnectorImpl;->class$javax$microedition$io$Connection:Ljava/lang/Class;

    :goto_1
    aget-object v5, v2, v1

    invoke-virtual {v4, v5}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 114
    aget-object v0, v2, v1

    .line 122
    :cond_0
    if-nez v0, :cond_6

    .line 123
    new-instance v4, Ljava/lang/ClassCastException;

    new-instance v5, Ljava/lang/StringBuffer;

    invoke-direct {v5}, Ljava/lang/StringBuffer;-><init>()V

    invoke-virtual {v3}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v5

    const-string v6, " Connection expected"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/ClassCastException;-><init>(Ljava/lang/String;)V

    throw v4

    .line 113
    :cond_1
    sget-object v4, Lorg/microemu/microedition/io/ConnectorImpl;->class$javax$microedition$io$Connection:Ljava/lang/Class;

    goto :goto_1

    .line 116
    :cond_2
    aget-object v4, v2, v1

    invoke-virtual {v4}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v4

    sget-object v5, Lorg/microemu/microedition/io/ConnectorImpl;->class$javax$microedition$io$Connection:Ljava/lang/Class;

    if-nez v5, :cond_4

    const-string v5, "javax.microedition.io.Connection"

    invoke-static {v6}, Lorg/microemu/microedition/io/ConnectorImpl;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v5

    sput-object v5, Lorg/microemu/microedition/io/ConnectorImpl;->class$javax$microedition$io$Connection:Ljava/lang/Class;

    :goto_2
    invoke-virtual {v5}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_3

    .line 117
    const-string v4, "ME2 Connection.class"

    sget-object v5, Lorg/microemu/microedition/io/ConnectorImpl;->class$javax$microedition$io$Connection:Ljava/lang/Class;

    if-nez v5, :cond_5

    const-string v5, "javax.microedition.io.Connection"

    invoke-static {v6}, Lorg/microemu/microedition/io/ConnectorImpl;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v5

    sput-object v5, Lorg/microemu/microedition/io/ConnectorImpl;->class$javax$microedition$io$Connection:Ljava/lang/Class;

    :goto_3
    invoke-static {v4, v5}, Lorg/microemu/log/Logger;->debugClassLoader(Ljava/lang/String;Ljava/lang/Object;)V

    .line 118
    new-instance v4, Ljava/lang/StringBuffer;

    invoke-direct {v4}, Ljava/lang/StringBuffer;-><init>()V

    invoke-virtual {v4, p1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v4

    const-string v5, " Connection.class"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v4

    aget-object v5, v2, v1

    invoke-static {v4, v5}, Lorg/microemu/log/Logger;->debugClassLoader(Ljava/lang/String;Ljava/lang/Object;)V

    .line 119
    const-string v4, "Connection interface loaded by different ClassLoader"

    invoke-static {v4}, Lorg/microemu/log/Logger;->error(Ljava/lang/String;)V

    .line 112
    :cond_3
    add-int/lit8 v1, v1, 0x1

    goto/16 :goto_0

    .line 116
    :cond_4
    sget-object v5, Lorg/microemu/microedition/io/ConnectorImpl;->class$javax$microedition$io$Connection:Ljava/lang/Class;

    goto :goto_2

    .line 117
    :cond_5
    sget-object v5, Lorg/microemu/microedition/io/ConnectorImpl;->class$javax$microedition$io$Connection:Ljava/lang/Class;

    goto :goto_3

    .line 125
    :cond_6
    sget-object v4, Lorg/microemu/microedition/io/ConnectorImpl;->class$org$microemu$microedition$io$ConnectorImpl:Ljava/lang/Class;

    if-nez v4, :cond_7

    const-string v4, "org.microemu.microedition.io.ConnectorImpl"

    invoke-static {v4}, Lorg/microemu/microedition/io/ConnectorImpl;->class$(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v4

    sput-object v4, Lorg/microemu/microedition/io/ConnectorImpl;->class$org$microemu$microedition$io$ConnectorImpl:Ljava/lang/Class;

    :goto_4
    invoke-virtual {v4}, Ljava/lang/Class;->getClassLoader()Ljava/lang/ClassLoader;

    move-result-object v4

    new-instance v5, Lorg/microemu/microedition/io/ConnectionInvocationHandler;

    invoke-direct {v5, v3, p4}, Lorg/microemu/microedition/io/ConnectionInvocationHandler;-><init>(Ljavax/microedition/io/Connection;Z)V

    invoke-static {v4, v2, v5}, Ljava/lang/reflect/Proxy;->newProxyInstance(Ljava/lang/ClassLoader;[Ljava/lang/Class;Ljava/lang/reflect/InvocationHandler;)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Ljavax/microedition/io/Connection;

    return-object p0

    .restart local p0
    :cond_7
    sget-object v4, Lorg/microemu/microedition/io/ConnectorImpl;->class$org$microemu$microedition$io$ConnectorImpl:Ljava/lang/Class;

    goto :goto_4
.end method


# virtual methods
.method public open(Ljava/lang/String;IZ)Ljavax/microedition/io/Connection;
    .locals 3
    .parameter "name"
    .parameter "mode"
    .parameter "timeouts"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 76
    :try_start_0
    new-instance v1, Lorg/microemu/microedition/io/ConnectorImpl$1;

    invoke-direct {v1, p0, p1, p2, p3}, Lorg/microemu/microedition/io/ConnectorImpl$1;-><init>(Lorg/microemu/microedition/io/ConnectorImpl;Ljava/lang/String;IZ)V

    iget-object v2, p0, Lorg/microemu/microedition/io/ConnectorImpl;->acc:Ljava/security/AccessControlContext;

    invoke-static {v1, v2}, Ljava/security/AccessController;->doPrivileged(Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Ljavax/microedition/io/Connection;
    :try_end_0
    .catch Ljava/security/PrivilegedActionException; {:try_start_0 .. :try_end_0} :catch_0

    return-object p0

    .line 85
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 86
    .local v0, e:Ljava/security/PrivilegedActionException;
    invoke-virtual {v0}, Ljava/security/PrivilegedActionException;->getCause()Ljava/lang/Throwable;

    move-result-object v1

    instance-of v1, v1, Ljava/io/IOException;

    if-eqz v1, :cond_0

    .line 87
    invoke-virtual {v0}, Ljava/security/PrivilegedActionException;->getCause()Ljava/lang/Throwable;

    move-result-object p0

    check-cast p0, Ljava/io/IOException;

    throw p0

    .line 89
    :cond_0
    new-instance v1, Ljava/io/IOException;

    invoke-virtual {v0}, Ljava/security/PrivilegedActionException;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v1
.end method
